home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / xceedzip / FRMPASSW.FRM (.txt) < prev    next >
Visual Basic Form  |  1999-04-26  |  4KB  |  98 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPassword 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Password protection"
  5.    ClientHeight    =   1830
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4215
  9.    ControlBox      =   0   'False
  10.    Icon            =   "frmPassword.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   1830
  15.    ScaleWidth      =   4215
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.CommandButton cmdCancel 
  18.       Cancel          =   -1  'True
  19.       Caption         =   "&Cancel"
  20.       Height          =   375
  21.       Left            =   2970
  22.       TabIndex        =   2
  23.       Top             =   600
  24.       Width           =   1095
  25.    End
  26.    Begin VB.CommandButton cmdOk 
  27.       Caption         =   "&OK"
  28.       Height          =   375
  29.       Left            =   2970
  30.       TabIndex        =   1
  31.       Top             =   150
  32.       Width           =   1095
  33.    End
  34.    Begin VB.TextBox txtPassword 
  35.       Height          =   285
  36.       IMEMode         =   3  'DISABLE
  37.       Left            =   120
  38.       MaxLength       =   80
  39.       PasswordChar    =   "*"
  40.       TabIndex        =   0
  41.       Top             =   480
  42.       Width           =   2655
  43.    End
  44.    Begin VB.Label lblPasswordExplanation 
  45.       Height          =   615
  46.       Left            =   120
  47.       TabIndex        =   4
  48.       Top             =   960
  49.       Width           =   2535
  50.    End
  51.    Begin VB.Label lblPassword 
  52.       Caption         =   "Enter a password:"
  53.       Height          =   255
  54.       Left            =   120
  55.       TabIndex        =   3
  56.       Top             =   120
  57.       Width           =   2655
  58.    End
  59. Attribute VB_Name = "frmPassword"
  60. Attribute VB_GlobalNameSpace = False
  61. Attribute VB_Creatable = False
  62. Attribute VB_PredeclaredId = True
  63. Attribute VB_Exposed = False
  64. Option Explicit
  65. '=========================================================================
  66. ' Description: The frmPassword form is used for prompting the user to
  67. '              enter a password. If no passwords is given by the user, the
  68. '              zip file's content will not be encrypted.
  69. '=========================================================================
  70. '------------------------------------------------------------------------------------
  71. ' Shows the Password dialog
  72. '------------------------------------------------------------------------------------
  73. Public Function ShowForm(xZip As XceedZip) As Boolean
  74.     frmPassword.Tag = "0"
  75.     ' Displays a text to explain how entering a password
  76.     ' will affect the zip file.
  77.     lblPasswordExplanation.Caption = "Enter a password above to protect " + _
  78.                                      "files from being unzipped without " + _
  79.                                      "first entering this same password."
  80.     ' Loads xZip's Password property to the "txtPassword" textbox.
  81.     frmPassword.txtPassword.Text = xZip.EncryptionPassword
  82.     ' Shows the form
  83.     frmPassword.Show vbModal
  84.     ' If tag = "1" then the user clicked on Ok and the password
  85.     ' value is copied in the xZip property
  86.     If frmPassword.Tag = "1" Then
  87.         xZip.EncryptionPassword = txtPassword.Text
  88.     End If
  89.     ShowForm = (frmPassword.Tag = "1")
  90. End Function
  91. Private Sub cmdCancel_Click()
  92.     Me.Hide
  93. End Sub
  94. Private Sub cmdOk_Click()
  95.     Me.Tag = "1"
  96.     Me.Hide
  97. End Sub
  98.